package com.sx.zongzhi.presenter;

import com.sx.zongzhi.MyApplication;
import com.sx.zongzhi.bean.OrganizingBean;
import com.sx.zongzhi.modle.ApiManager;
import com.sx.zongzhi.net.BaseCallBack;
import com.sx.zongzhi.net.BaseResult;
import com.sx.zongzhi.view.IOrganizingView;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by XZY on 2017/11/30.
 *获取组织机构
 */
public class OrganizingPest {

    private IOrganizingView iOrganizingView;

    public OrganizingPest(IOrganizingView iOrganizingView) {
        this.iOrganizingView=iOrganizingView;
    }

    public void getOrganizing(){
        Map<String,Object> map=new HashMap<>();
        map.put("sid", MyApplication.sid);
        new ApiManager().getOrg(map, new BaseCallBack<BaseResult<OrganizingBean>>() {
            @Override
            public void onSuccess(BaseResult<OrganizingBean> response) {
                iOrganizingView.getOrg(response.getData());
            }
            @Override
            public void onFailures(String message) {
                iOrganizingView.showError(message);
            }
        });
    }
}
